<template>
  <el-card>
    <el-col :span="24">
      <el-descriptions :column="2">
        <el-descriptions-item>
          <template #label>
            <descriptions-item-label label="退款编码" />
          </template>
          {{ data.no }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <descriptions-item-label label="用户ID" />
          </template>
          {{ data.userId }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <descriptions-item-label label="用户昵称" />
          </template>
          {{ data.nickName }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <descriptions-item-label label="活动编码" />
          </template>
          {{ data.activeNo }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <descriptions-item-label label="活动名称" />
          </template>
          {{ data.activeName }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <descriptions-item-label label="退款原因" />
          </template>
          {{ data.applyReason }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <descriptions-item-label label="退款金额" />
          </template>
          {{ data.refundPrice }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <descriptions-item-label label="申请时间" />
          </template>
          {{ formatDate(data.createTime) }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <descriptions-item-label label="状态" />
          </template>
          <dict-tag
            v-if="data.status != undefined"
            :type="DICT_TYPE.AUDITSTATUS"
            :value="data.status"
          />
        </el-descriptions-item>
      </el-descriptions>

      <div>
        <span class="mr5 inline-block vertical-top">退款凭证:</span>
        <template v-for="item in data.applyPicUrls" :key="item.id">
          <el-avatar shape="square" :size="100" :src="item" class="mr3 inline-block" />
        </template>
      </div>
    </el-col>
  </el-card>
</template>
<script setup lang="ts">
import { formatDate } from '@/utils/formatTime'
import { DICT_TYPE } from '@/utils/dict'

const { data } = defineProps<{ data }>()
</script>
<style scoped lang="scss">
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
</style>
